{% extends "cmdb/mbusiness/index.html" %}
{% block right_content %}

<div id="right_menu">
    <table id="example" style="table-layout:fixed;" class="table table-bordered table-hover">

        <thead >
        <td class="col">设备编号</td>
        <td class="col">设备类型</td>
        <td class="col">内网IP</td>
        <td class="col">机房</td>
        </thead>
        {% if equipment_list %}
        {% for equipment in equipment_list %}

        <tr>
            <td class="col">{{ equipment.equipment_no }}</td>
            <td class="col">{{ equipment.equipment_type_desc }}</td>
            <td class="col">{{ equipment.sys_ip_inner }}</td>
            <td class="col">{{ equipment.server_room }}</td>
        </tr>
        {% endfor %}
        {% endif %}
    </table>

    <div>
        <span>跳转到
         <select class="pagei">
             {% for temppage in page_list %}
             <option value="{{ temppage }}" {% ifequal temppage page %}selected {% endifequal %}>{{ temppage }}</option>
             {% endfor %}
         </select>页
        </span>
        <span style="padding-left: 28%;">每页{{ page_num }}条，第{{ page }}页，共{{ count }}条，共{{ page_total }}页</span>
        <span style="float:right;padding-right:50px">

            <a class="word hint hint-top" data-hint="首页" href="{% url 'business:buffer' %}?page=1"><span class="glyphicon glyphicon-fast-backward"></span></a>
            {% ifnotequal page 1 %}&nbsp;
            <a class="hint hint-top" data-hint="上一页" href="{% url 'business:buffer' %}?page={{ page|add:-1 }}"><span class="glyphicon glyphicon-step-backward"></span></a>
            {% endifnotequal %}
            {% ifnotequal page page_total %}&nbsp;
            <a class="hint hint-top" data-hint="下一页" href="{% url  'business:buffer' %}?page={{ page|add:1 }}"><span class="glyphicon glyphicon-step-forward"></span></a>
            {% endifnotequal %}&nbsp;
            <a class="word hint hint-top" data-hint="尾页" href="{% url 'business:buffer' %}?page={{ page_total }}"><span class="glyphicon glyphicon-fast-forward"></span></a>

        </span>
    </div>

</div>
<script type="text/javascript">

    $(".pagei").change(function(){

        var index=$(this).children('option:selected').val();
        window.location.href="{% url 'business:buffer' %}?page=" +index;

    });

</script>
{% endblock %}

